package alpha.com.google.code.mechanic.janitor.model;

import static org.junit.Assert.*;

import java.io.File;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import alpha.com.google.code.mechanic.janitor.model.DefaultSysFilePath;

import com.google.eclipse.mechanic.tests.internal.RunAsJUnitTest;

/**
 * This is to test the class {@link DefaultSysFilePathTes}.
 * 
 * @author jingjiejiang
 * @since Nov 27, 2014
 */

@RunAsJUnitTest
public class DefaultSysFilePathTest {

  private DefaultSysFilePath defSysPath;
  
  @Before
  public void setUp() throws Exception {
    defSysPath =  new DefaultSysFilePath(); 
  }

  @After
  public void tearDown() throws Exception {
    
  }

  @Test
  public void tesInitDefSysFilePath() {
    
    String path = defSysPath.getDefaultSysFilePath();
    
    assertTrue(path.contains(".eclipse" + File.separator + "mechanic" +
        File.separator));
    assertFalse(path.contains(".eclipse" + File.separator + "mechanic" +
        File.separator + "Contexts" + File.separator));
  }

  @Test
  public void testInitCtxFileDir() {
    
    defSysPath.initCtxFileDir();
    String path = defSysPath.getDefaultSysFilePath();
    
    assertTrue(path.contains(".eclipse" + File.separator + "mechanic" +
        File.separator + "Contexts" + File.separator));
  }

}
